home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / util / cli / flp_by_anp.lha / FLP_BY_ANP / CS.doc < prev    next >
Text File  |  1996-02-24  |  4KB  |  82 lines

  1.  
  2. *****************************************************************************
  3. * Project Details                                                           *
  4. * ---------------                                                           *
  5. * Project Name:    CS (Clear Screen)                                        *
  6. * Project Version: 1                                                        *
  7. * Copyright:       Anthony N Peck                                           *
  8. * Date:            Sunday 28th May 1995                                     *
  9. *                                                                           *
  10. * Contact:                                                                  *
  11. * 68 Woralul ST                                                             *
  12. * Waramanga ACT 2611                                                        *
  13. * AUSTRALIA                                                                 *
  14. *                                                                           *
  15. * E-Mail: Anthony.Peck@Radford.act.edu.au                                   *
  16. *                                                                           *
  17. *****************************************************************************
  18. * Project Summary:                                                          *
  19. * ---------------                                                           *
  20. *                                                                           *
  21. * Usage: CS                                                                 *
  22. *                                                                           *
  23. * Simply clears the screen by writing a "CONTROL L" character to the CLI or *
  24. * Shell window.  As opposed to my normal modus operandi, this code contains *
  25. * examples of how to save space so that the executable is small (e.g. no    *
  26. * macros in this code).  Instead of the DosBase being saved to a memory     *
  27. * location, it is stored in the A4 register.  All up these savings change   *
  28. * the executable size from an original 166 bytes to the 116 bytes that you  *
  29. * see now.  There is no real advantage to such a saving, but I thought you  *
  30. * might like to see it anyhow!  The program and the source are FREEWARE!    *
  31. *                                                                           *
  32. *****************************************************************************
  33.  
  34. ; Some Quick equivalents...
  35.  
  36. ExecBase            = $04          ; Exec Base...ahem
  37. Openlibrary         = -$0228       ; Exec function opens libraries
  38. Closelibrary        = -$019e       ; Exec function closes libraries
  39. Write               = -$30         ; Dos function writes to shell
  40. Output              = -$3C         ; Dos function gets output handle
  41.  
  42. Start:
  43.  
  44. ; Program really starts here...
  45.  
  46.         MOVE.L  ExecBase,A6        ; Move Exec into A6
  47.         LEA     Dosname,A1         ; Load the dos library
  48.         CLR.L   D0                 ; Any version will do
  49.         JSR     Openlibrary(A6)    ; Jump to open library routine
  50.         BEQ     Exit               ; If there's a problem, close down
  51.         MOVE.L  D0,A4              ; Save DosBase to A4
  52.         JSR     Output(A4)         ; Jump to output routine
  53.         MOVE.L  D0,D1              ; Shift output handle to D1
  54.         MOVE.L  #Clear,D2          ; This is the Clear character
  55.         MOVE.L  #$01,D3            ; it's only one byte in length
  56.         JSR     Write(A4)          ; Jump to the Write routine
  57.  
  58. ; Clean up and finish...
  59.  
  60. Close:        
  61.  
  62.         MOVE.L  A4,A1              ; Move Dos Base from A4 to A1
  63.         JSR     Closelibrary(A6)   ; Jump to Close library routine
  64.                                    ; NB: $04 still in A6 from
  65.                                    ;     previous exec call...
  66.  
  67. Exit:
  68.  
  69.         CLR.L   D0                 ; Clear D0
  70.         RTS                        ; Return To System
  71.  
  72. ; Memory Allocations
  73.  
  74. Dosname:
  75.  
  76.         DC.B    "dos.library",$00  ; dos library name
  77.  
  78. Clear:  DC.B    $0C                ; Control L (Clear)
  79.  
  80.         END
  81.  
  82.